package com.ftg.wymall.admin.mapper;

import com.ftg.wymall.admin.entity.UmsRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 后台用户角色表 Mapper 接口
 * </p>
 *
 * @author kangjx
 * @since 2023-10-27
 */
@Mapper
public interface UmsRoleMapper extends BaseMapper<UmsRole> {

    /**
     * 切换状态
     * @param id 主键
     * @return 成功 失败
     */
    @Update("update ums_role set status = if(status=0,1,0) where id = #{id}")
    Boolean switchStatus(@Param("id") Long id);
}
